{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "l = [1,2,3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "min(l)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/min-stack\n",
    "\n",
    "\n",
    "\n",
    "Runtime: 616 ms, faster than 17.40% of Python3 online submissions for Min Stack.\n",
    "Memory Usage: 18.1 MB, less than 39.35% of Python3 online submissions for Min Stack.\n",
    "\n",
    "\n",
    "\n",
    "```python\n",
    "class MinStack:\n",
    "\n",
    "    def __init__(self):\n",
    "        \"\"\"\n",
    "        initialize your data structure here.\n",
    "        \"\"\"\n",
    "        self.stack = []\n",
    "        \n",
    "\n",
    "    def push(self, x: int) -> None:\n",
    "        self.stack.append(x)\n",
    "\n",
    "    def pop(self) -> None:\n",
    "        r = self.stack[-1]\n",
    "        self.stack = self.stack[:-1]\n",
    "        return r\n",
    "        \n",
    "    def top(self) -> int:\n",
    "        return self.stack[-1]\n",
    "        \n",
    "\n",
    "    def getMin(self) -> int:\n",
    "        return min(self.stack)\n",
    "```\n",
    "\n",
    "\n",
    "spent 6 minutes\n",
    "\n",
    "one shoot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
